.TH "ZIP_SET_DEFAULT_PASSWORD" "3" "January 3, 2011" "NiH" "Library Functions Manual"
.nh
.if n .ad l
.SH "NAME"
\fBzip_set_default_password\fR
\- set default password for encrypted files in zip
.SH "LIBRARY"
libzip (-lzip)
.SH "SYNOPSIS"
\fB#include <zip.h>\fR
.sp
\fIint\fR
.br
\fBzip_set_default_password\fR(\fIstruct zip *archive\fR,\ \fIconst char *password\fR);
.SH "DESCRIPTION"
The
\fBzip_set_default_password\fR()
function sets the default password used when accessing encrypted files.
If
\fIpassword\fR
is
\fRNULL\fR,
the default password is unset.
.PP
If you prefer a different password for single files, use
zip_fopen_encrypted(3)
instead of
zip_fopen(3).
Usually, however, the same password is used for every file in an
zip archive.
.SH "RETURN VALUES"
Upon successful completion 0 is returned.
Otherwise, \-1 is returned and the error information in
\fIarchive\fR
is set to indicate the error.
.SH "ERRORS"
\fBzip_set_default_password\fR()
fails if:
.TP 19n
[\fRZIP_ER_MEMORY\fR]
Required memory could not be allocated.
.SH "SEE ALSO"
libzip(3),
zip_fopen(3),
zip_fopen_encrypted(3)
.SH "AUTHORS"
Dieter Baron <\fIdillo@nih.at\fR>
and
Thomas Klausner <\fItk@giga.or.at\fR>
